package com.zb.vo;

import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.zb.annotation.NumberPattern;
import com.zb.entity.ZjNetworkStrategy;
import com.zb.utils.VerificUtil;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.List;

/**
 * @Author WEN
 * @Date 2023/10/18 0018
 **/
@Data
@ApiModel("服务商策略对象")
public class NetworkStrategyVo {
    @NotNull(message = "自动审核取消工单项不能为空")
    @ApiModelProperty(value = " 是否自动审核取消工单：false-人工审核，true-自动审核", required = true, example = "false")
    private Boolean autoCheckCancelOrder;

    @NotNull(message = "自动审核申请结单项不能为空")
    @ApiModelProperty(value = "是否自动审核申请结单：false-人工审核，true-自动审核", required = true, example = "false")
    private Boolean autoCheckEndOrder;

    @NotNull(message = "启用更改备件价格项不能为空")
    @ApiModelProperty(value = "是否启用更改备件价格：false-不允许修改，true-允许修改", required = true, example = "false")
    private Boolean enableUpdateSparePrice;

    @NotNull(message = "确认接单策略项不能为空")
    @ApiModelProperty(value = "确认接单策略： false：人工确认，true：自动确认", required = true, example = "true")
    private Boolean autoSureReceiveOrder;

    @NotNull(message = "提现手续费策略不能为空")
    @NumberPattern(regexp = "^(1|2)$", required = true, message = "提现手续费策略参数不合法")
    @ApiModelProperty(value = "提现手续费策略：1-按比例收取(按提现总金额计算)，2-每间固定(按每单总金额计算)", required = true, example = "1")
    private Integer withdrawHandlingFeeStrategy;

    @NotNull(message = "手续费比例不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "手续费比例最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "手续费比例，单位为%，当withdrawHandlingFeeStrategy=1时生效", required = true, example = "0")
    private BigDecimal handingFeeProportion;

    @NotNull(message = "每单固定手续费不能为空")
    @NumberPattern(regexp = VerificUtil.FLOATING_NUMBER_10_2, required = true, message = "每单固定手续费最多允许输入8位整数，两位小数")
    @ApiModelProperty(value = "每单固定手续费：当withdrawHandlingFeeStrategy=2时生效", required = true, example = "0")
    private BigDecimal handingFeeFixedOrder;

    @NotNull(message = "允许提现项不能为空")
    @ApiModelProperty(value = "是否允许提现：false-不允许，true-允许", required = true, example = "true")
    private Boolean allowWithdrawal;

    @ApiModelProperty(value = "提现人员权限对象，团队负责人ID值为-1，当allowWithdrawal=true 时生效")
    private List<Long> withdrawEmpRootVos;

    @NotNull(message = "允许查看费用项不能为空")
    @ApiModelProperty(value = "是否允许查看费用：false-不允许，true-允许", required = true, example = "true")
    private Boolean allowSelectFee;

    @NotNull(message = "允许管理员代提现项不能为空")
    @ApiModelProperty(value = "是否允许管理员代提现：false-不允许，true-允许", required = true, example = "true")
    private Boolean allowManagerHelpWithdraw;

    @ApiModelProperty(value = "费用查询人员权限对象，团队负责人ID值为-1，当allowSelectFee=true时生效")
    private List<Long> selectFeeEmpRootVos;

    public NetworkStrategyVo() {}

    public NetworkStrategyVo(ZjNetworkStrategy strategy) {
        BeanUtil.copyProperties(strategy, this);
    }


}
